<template>
  <div>

    <el-steps :active="active" finish-status="success">
      <el-step title="基础1信息"></el-step>
      <el-step title="商务条款"></el-step>
      <el-step title="收款计划"></el-step>
      <el-step title="其他条款"></el-step>
    </el-steps>

    <!--    <el-button style="margin-top: 12px;" @click="next">下一步</el-button>-->
    <!--    <el-button style="margin-top: 12px;" @click="nextS">上一步</el-button>-->
    <el-row :gutter="15">

      <el-form style="color: black!important;" ref="elForm" :model="dataForm" :rules="dataRule" size="medium"
               label-width="140px" label-position="right"
               :disabled="setting.readonly"
      >
        <template v-if="!loading && formOperates">
          <el-col :span="24">

            <div v-if="active==0">
              <!--              <el-col :span="6" v-if="!setting.readonly"-->
              <!--              >-->
              <!--                <el-form-item label="流程标题"-->
              <!--                              prop="title"-->
              <!--                >-->
              <!--                  <el-input  v-model="dataForm.title"-->
              <!--                            placeholder="请输入"  clearable-->
              <!--                            :style='{"width":"100%"}'-->
              <!--                  >-->

              <!--                  </el-input>-->
              <!--                </el-form-item>-->
              <!--              </el-col>-->
              <el-col :span="6" v-if="judgeShow('contractNumber')"
              >
                <el-form-item label="合同编号" prop="contractNumber">
                  <el-input v-model="dataForm.contractNumber"
                            placeholder="请输入"
                            :disabled="judgeWrite('contractNumber')"
                            clearable
                            :style='{"width":"100%"}'>
                  </el-input>
                </el-form-item>
              </el-col>

              <el-col :span="6" v-if="judgeShow('nbContractNumber')"
              >
                <el-form-item label="内部合同编号" prop="nbContractNumber">
                  <el-input v-model="dataForm.nbContractNumber"
                            placeholder="请输入"
                            :disabled="judgeWrite('nbContractNumber')"
                            clearable
                            :style='{"width":"100%"}'>
                  </el-input>
                </el-form-item>
              </el-col>

              <el-col :span="6" v-if="judgeShow('contractHandler')"
              >
                <el-form-item label="合同经办人"
                              prop="contractHandler"
                >
                  <user-select v-model="dataForm.contractHandler"
                               placeholder="请选择" :disabled="judgeWrite('contractHandler')" clearable
                  >

                  </user-select>
                </el-form-item>
              </el-col>

              <el-col :span="6" v-if="judgeShow('project')"
              >

              </el-col>

              <el-col :span="6" v-if="judgeShow('signingDate')"
              >
                <el-form-item label="合同签订日期"
                              prop="signingDate"
                >
                  <el-date-picker v-model="dataForm.signingDate"
                                  placeholder="请选择" :disabled="judgeWrite('signingDate')" clearable
                                  :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp"
                  >

                  </el-date-picker>
                </el-form-item>
              </el-col>

              <el-col :span="6" v-if="judgeShow('purposeHouse')"
              >
                <el-form-item label="经营业态"
                              prop="purposeHouse"
                >
                  <el-input v-model="dataForm.purposeHouse"
                            placeholder="请输入" :disabled="judgeWrite('purposeHouse')" clearable
                            :style='{"width":"100%"}'
                  >
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="是否属于九小" prop="customerNature">
                  <el-radio-group v-model="dataForm.isLongTermPlace" size="small">
                    <el-radio label="是">是</el-radio>
                    <el-radio label="否">否</el-radio>
                  </el-radio-group>
                </el-form-item>
              </el-col>

              <el-col :span="6" v-if="judgeShow('ihis')"
              >
                <el-form-item label="是否为存续合同"
                              prop="ihis"
                >
                  <el-switch v-model="dataForm.ihis"
                             :disabled="judgeWrite('ihis')" :active-value="1" :inactive-value="0"
                  >

                  </el-switch>
                </el-form-item>
              </el-col>

              <el-col :span="6" v-if="judgeShow('htFile')"
              >
                <el-form-item label="合同相关资料"
                              prop="htFile">
                  <JNPF-UploadFz v-model="dataForm.htFile"
                                 :fileSize="10" :disabled="judgeWrite('htFile')" sizeUnit="MB" :limit="9"
                                 buttonText="上传附件">

                  </JNPF-UploadFz>
                </el-form-item>
              </el-col>

              <el-col :span="24" v-if="judgeShow('notes')"
              >
                <el-form-item label="备注"
                              prop="notes"
                >
                  <el-input v-model="dataForm.notes"
                            placeholder="请输入" :disabled="judgeWrite('notes')" :style='{"width":"100%"}' true
                            type="textarea" :autosize='{"minRows":4,"maxRows":4}'
                  >

                  </el-input>
                </el-form-item>
              </el-col>


              <el-col :span="24">
                <el-card class="mb-20" shadow="always" header="甲方">
                  <el-col :span="9" v-if="judgeShow('partyName')"
                  >
                    <el-form-item label="甲方名称"
                                  prop="partyName"
                    >
                      <el-input v-model="dataForm.partyName"
                                placeholder="请输入甲方名称" :disabled="judgeWrite('partyName')" clearable
                                :style='{"width":"100%"}'
                      >

                      </el-input>
                    </el-form-item>
                  </el-col>

                  <el-col :span="5" v-if="judgeShow('partyContacts')"
                  >
                    <el-form-item label="甲方联系人"
                                  prop="partyContacts"
                    >
                      <el-input v-model="dataForm.partyContacts"
                                placeholder="请输入" :disabled="judgeWrite('partyContacts')" clearable
                                :style='{"width":"100%"}'
                      >

                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="9" v-if="judgeShow('partyContactInformation')"
                  >
                    <el-form-item label="甲方联系方式"
                                  prop="partyContactInformation"
                    >
                      <el-input v-model="dataForm.partyContactInformation"
                                placeholder="请输入" :disabled="judgeWrite('partyContactInformation')" clearable
                                :style='{"width":"100%"}'
                      >

                      </el-input>
                    </el-form-item>
                  </el-col>
                </el-card>
              </el-col>
              <el-col :span="24">
                <el-card class="mb-20" shadow="always" header="乙方客户信息">
                  <el-col :span="24" v-if="judgeShow('zcglhtglpabList') && formOperates">
                    <el-form-item label-width="0">
                      <div class="JNPF-common-title">
                        <h2></h2>
                      </div>
                      <el-table :data="dataForm.zcgl_htgl_pab" size="mini">
                        <el-table-column type="index" width="70" label="序号" align="center"/>
                        <el-table-column prop="pabCustomerName" label="乙方客户名称" width="180" align="center"
                                         v-if="judgeShow('zcglhtglpabList-pabCustomerName')"
                        >
                          <template slot-scope="scope">
                            <el-form-item :prop="'zcgl_htgl_pab.' + scope.$index + '.pabCustomerName'"
                            >
                              <el-select v-model="scope.row.pabCustomerName" placeholder="请选择"
                                         :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabCustomerName')"
                                         clearable :style='{"width":"100%"}'
                                         @change="handleCustomerNameChange(scope.$index, scope.row)"
                              >
                                <el-option v-for="(item, index) in kfList" :key="index" :label="item.customerName"
                                           :value="item.id" :disabled="item.disabled"
                                >
                                </el-option>
                              </el-select>
                            </el-form-item>
                          </template>
                        </el-table-column>
                        <el-table-column prop="pabContacts" label="乙方联系人"
                                         v-if="judgeShow('zcglhtglpabList-pabContacts')"
                        >

                          <template slot-scope="scope">
                            <el-form-item :prop="'zcgl_htgl_pab.' + scope.$index + '.pabContacts'"
                            >
                              <el-input v-model="scope.row.pabContacts"
                                        placeholder="请输入"
                                        :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabContacts')"
                                        clearable :style='{"width":"100%"}'
                              >
                              </el-input>
                            </el-form-item>
                          </template>
                        </el-table-column>

                        <el-table-column prop="pabContactNumber" label="乙方联系电话"
                                         v-if="judgeShow('zcglhtglpabList-pabContactNumber')"
                        >

                          <template slot-scope="scope">
                            <el-form-item :prop="'zcgl_htgl_pab.' + scope.$index + '.pabContactNumber'"
                            >
                              <el-input v-model="scope.row.pabContactNumber"
                                        placeholder="请输入"
                                        :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabContactNumber')"
                                        clearable :style='{"width":"100%"}'
                              >
                              </el-input>
                            </el-form-item>
                          </template>
                        </el-table-column>

                        <el-table-column prop="pabIdType" label="乙方证件类型"
                                         v-if="judgeShow('zcglhtglpabList-pabIdType')"
                        >

                          <template slot-scope="scope">
                            <el-form-item :prop="'zcgl_htgl_pab.' + scope.$index + '.pabIdType'"
                            >
                              <el-input v-model="scope.row.pabIdType"
                                        placeholder="请输入"
                                        :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabIdType')"
                                        clearable :style='{"width":"100%"}'
                              >
                              </el-input>
                            </el-form-item>
                          </template>
                        </el-table-column>

                        <el-table-column prop="pabIdNo" label="乙方证件号码"
                                         v-if="judgeShow('zcglhtglpabList-pabIdNo')"
                        >

                          <template slot-scope="scope">
                            <el-form-item :prop="'zcgl_htgl_pab.' + scope.$index + '.pabIdNo'"
                            >
                              <el-input v-model="scope.row.pabIdNo"
                                        placeholder="请输入"
                                        :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabIdNo')"
                                        clearable :style='{"width":"100%"}'
                              >
                              </el-input>
                            </el-form-item>
                          </template>
                        </el-table-column>

                        <el-table-column prop="pabContactAddress" label="乙方联系地址"
                                         v-if="judgeShow('zcglhtglpabList-pabContactAddress')"
                        >
                          <template slot="header" v-if="judgeRequired('zcglhtglpabList-pabContactAddress')">
                            <span class="required-sign">*</span>乙方联系地址
                          </template>
                          <template slot-scope="scope">
                            <el-input v-model="scope.row.pabContactAddress"
                                      placeholder="请输入"
                                      :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabContactAddress')"
                                      clearable :style='{"width":"100%"}'
                            >
                            </el-input>
                          </template>
                        </el-table-column>
                        <el-table-column label="操作" width="70"
                                         v-if="!setting.readonly && !judgeWrite('zcglhtglpabList')"
                        >
                          <template slot-scope="scope">
                            <el-button size="mini" type="text" class="JNPF-table-delBtn"
                                       @click="delzcglhtglpabList(scope.$index)"
                            >删除
                            </el-button>
                          </template>
                        </el-table-column>
                      </el-table>
                      <div class="table-actions" @click="addzcglhtglpabList()">
                        <el-button type="text" icon="el-icon-plus">添加</el-button>
                      </div>
                    </el-form-item>
                  </el-col>
                </el-card>
              </el-col>
            </div>
            <div v-if="active == 1">

              <el-col :span="8" v-if="judgeShow('contractType')"
              >
                <el-form-item label="合同类型"
                              prop="contractType"
                >
                  <el-select v-model="dataForm.contractType"
                             @change="changeType"
                             placeholder="请选择" :disabled="judgeWrite('contractType')" clearable
                             :style='{"width":"100%"}'
                  >
                    <el-option v-for="(item, index) in htTypeOptions" :key="index" :label="item.fullName"
                               :value="item.fullName" :disabled="item.disabled"
                    ></el-option>

                  </el-select>
                </el-form-item>
              </el-col>

              <el-col :span="8" v-if="judgeShow('startTime') "
              >
                <el-form-item label="合同起始日期"
                              prop="startTime"
                >
                  <el-date-picker v-model="dataForm.startTime"
                                  @change="check(dataForm)"
                                  placeholder="请选择" :disabled="judgeWrite('startTime')" clearable
                                  :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp"
                  >

                  </el-date-picker>
                </el-form-item>
              </el-col>

              <el-col :span="8" v-if="judgeShow('endTime') && dataForm.contractType!='无固定期限'"
              >
                <el-form-item label="合同结束日期"
                              prop="endTime"
                >
                  <el-date-picker v-model="dataForm.endTime"
                                  @change="check(dataForm)"
                                  placeholder="请选择" :disabled="judgeWrite('endTime')" clearable
                                  :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp"
                  >

                  </el-date-picker>
                </el-form-item>
              </el-col>

              <el-col :span="8" v-if="judgeShow('contractPeriod')"
              >
                <el-form-item label="合同期限"
                              prop="contractPeriod"
                >
                  <el-input v-model="dataForm.contractPeriod"
                            placeholder="请输入" :disabled="judgeWrite('contractPeriod')" clearable
                            :style='{"width":"100%"}'
                  >

                  </el-input>
                </el-form-item>
              </el-col>

              <el-col :span="8" v-if="judgeShow('advancePaymentDays')">
                <el-form-item label="提前缴费天数" prop="advancePaymentDays">
                  <el-input-number
                    v-model="dataForm.advancePaymentDays"
                    placeholder="请输入"
                    :disabled="judgeWrite('advancePaymentDays')"
                    :style='{"width":"100%"}'
                    clearable
                    :min="0"
                    :max="10000"
                  />
                </el-form-item>
              </el-col>

              <el-col :span="24">
                <el-card class="mb-20" shadow="always" header="租赁资产">
                  <el-col :span="24" v-if="judgeShow('zcglhtglpabspaceList') && formOperates">
                    <el-form-item label-width="0">
                      <div class="JNPF-common-title">
                        <h2></h2>
                      </div>
                      <el-table :data="dataForm.zcgl_htgl_pab_space1" size="mini">
                        <el-table-column type="index" width="70" label="序号" align="center"/>
                        <el-table-column prop="zcname" label="资产名称"
                                         v-if="judgeShow('zcglhtglpabspaceList-spaceName')"
                        >
                          <template slot="header" v-if="judgeRequired('zcglhtglpabspaceList-spaceName')">
                            <span class="required-sign">*</span>资产名称
                          </template>
                          <template slot-scope="scope">
                            <el-input v-model="scope.row.zcname"
                                      placeholder="请输入"
                                      :disabled="judgeWrite('zcglhtglpabspaceList') || judgeWrite('zcglhtglpabspaceList-spaceName')"
                                      clearable :style='{"width":"100%"}'
                            >
                            </el-input>
                          </template>
                        </el-table-column>
                        <el-table-column v-if="judgeShow('zcglhtglpabspaceList-operatingArea')" label="资产编码"
                                         prop="zcnumber"
                        >
                          <template v-if="judgeRequired('zcglhtglpabspaceList-operatingArea')" slot="header">
                            <span class="required-sign">*</span>资产编码
                          </template>
                          <template slot-scope="scope">
                            <el-input v-model="scope.row.zcnumber"
                                      :disabled="judgeWrite('zcglhtglpabspaceList') || judgeWrite('zcglhtglpabspaceList-operatingArea')"
                                      :style='{"width":"100%"}'
                                      clearable placeholder=""
                            >
                            </el-input>
                          </template>
                        </el-table-column>
<!--                        <el-table-column prop="address" label="资产地址"-->
<!--                                         v-if="judgeShow('zcglhtglpabspaceList-spaceType')"-->
<!--                        >-->
<!--                          <template slot="header" v-if="judgeRequired('zcglhtglpabspaceList-spaceType')">-->
<!--                            <span class="required-sign">*</span>资产地址-->
<!--                          </template>-->
<!--                          <template slot-scope="scope">-->
<!--                            <el-input v-model="scope.row.address"-->
<!--                                      placeholder="请输入"-->
<!--                                      :disabled="judgeWrite('zcglhtglpabspaceList') || judgeWrite('zcglhtglpabspaceList-spaceType')"-->
<!--                                      clearable :style='{"width":"100%"}'-->
<!--                            >-->
<!--                            </el-input>-->
<!--                          </template>-->
<!--                        </el-table-column>-->

<!--                        <el-table-column prop="buildingmeasurementarea" label="建筑测量面积"-->
<!--                                         v-if="judgeShow('zcglhtglpabspaceList-buildingmeasurementarea')"-->
<!--                        >-->
<!--                          <template slot="header" v-if="judgeRequired('zcglhtglpabspaceList-buildingmeasurementarea')">-->
<!--                            <span class="required-sign">*</span>建筑测量面积-->
<!--                          </template>-->
<!--                          <template slot-scope="scope">-->
<!--                            <el-input v-model="scope.row.zcgl_zcdj_area.buildingmeasurementarea"-->
<!--                                      placeholder="请输入"-->
<!--                                      :disabled="judgeWrite('zcglhtglpabspaceList') || judgeWrite('zcglhtglpabspaceList-buildingmeasurementarea')"-->
<!--                                      clearable :style='{"width":"100%"}'-->
<!--                            >-->
<!--                            </el-input>-->
<!--                          </template>-->
<!--                        </el-table-column>-->

                        <el-table-column label="操作" width="50"
                                         v-if="!setting.readonly && !judgeWrite('zcglhtglpabspaceList')"
                        >
                          <template slot-scope="scope">
                            <el-button size="mini" type="text" class="JNPF-table-delBtn"
                                       @click="delzcglhtglpabspaceList(scope.$index)"
                            >删除
                            </el-button>
                          </template>
                        </el-table-column>
                      </el-table>
                      <div class="table-actions" @click="addzcglhtglpabspaceList()">
                        <!--                          <el-button type="text" icon="el-icon-plus">添加</el-button>-->
                        <Popup v-model="dataForm.lastmodifytime"
                               @addList="handleAddList"

                               placeholder="请选择" clearable field="assetName" interfaceId="612769091110831365"
                               :columnOptions="lastmodifytimecolumnOptions" propsValue="id" relationField="zcname"
                               popupType="dialog"
                               popupTitle="选择资产" popupWidth="800px"
                               hasPage :pageSize="20"
                        >
                        </Popup>
                      </div>
                    </el-form-item>
                  </el-col>
                </el-card>
              </el-col>
              <el-col :span="24">
                <el-card class="mb-20" shadow="always" header="租金费用条款">

                  <el-row v-for="(item, index) in dataForm.zcgl_htgl_pab_fytk" :key="index">
                    <el-row>

                      <el-col :span="8" v-if="judgeShow('jnpf_zcgl_htgl_pab_fytk_jnpf_startTime')"
                      >
                        <el-form-item label="关联资产"
                                      disabled
                                      :prop="getItemProp_zcgl_htgl_pab_fytk(index, 'relatedSpace')"
                                      v-show="false"
                        >
                          <!--                            :disabled="judgeWrite('relatedSpace')"-->
                          <el-select multiple v-model="item.relatedSpace"
                                     clearable
                                     :style='{"width":"100%"}'
                                     @change="toGetArea(item)"
                          >
                            <el-option v-for="(item, index) in dataForm.zcgl_htgl_pab_space1" :key="index"
                                       :label="item.zcname"
                                       :value="item.id" :disabled="item.disabled"
                            ></el-option>

                          </el-select>
                        </el-form-item>
                      </el-col>

                      <el-col :span="8" v-if="judgeShow('rentalArea')"
                      >
                        <el-form-item label="租赁面积㎡"
                                      prop="rentalArea"
                        >

                          <el-input v-model="item.rentalArea"
                                    placeholder="请输入" :disabled="judgeWrite('rentalArea')"
                                    clearable :style='{"width":"80%"}'
                          >
                          </el-input>
                        </el-form-item>
                      </el-col>

                      <el-col :span="8" v-if="judgeShow('jnpf_zcgl_htgl_pab_fytk_jnpf_startTime')"
                      >
                        <el-form-item
                          :prop="getItemProp_zcgl_htgl_pab_fytk(index, 'rentMethod')"
                          label="计租方式"
                        >
                          <!--                            :disabled="judgeWrite('relatedSpace')"-->
                          <el-select
                            v-model="item.rentMethod"
                            clearable
                            clearable :style='{"width":"80%"}'
                          >
                            <el-option
                              label="固定租金"
                              value="固定租金"
                            ></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>

                      <el-col :span="8" v-if="judgeShow('jnpf_zcgl_htgl_pab_fytk_jnpf_startTime')"
                      >
                        <el-form-item label="费用项"
                                      :prop="getItemProp_zcgl_htgl_pab_fytk(index, 'expenseType')"
                        >
                          <!--                            :disabled="judgeWrite('relatedSpace')"-->
                          <el-select

                            v-model="item.expenseType"
                            clearable
                            clearable :style='{"width":"80%"}'
                          >
                            <el-option
                              label="房屋租金"
                              value="1"
                            ></el-option>
                            <el-option
                              label="物业"
                              value="2"
                            ></el-option>
                            <el-option
                              label="其他费用"
                              value="3"
                            ></el-option>
                          </el-select>
                        </el-form-item>
                      </el-col>
                    </el-row>

                    <el-row>

                      <el-col :span="8" v-if="judgeShow('jnpf_zcgl_htgl_pab_fytk_jnpf_taxRate')">
                        <el-form-item label="税率(%)" prop="jnpf_zcgl_htgl_pab_fytk_jnpf_taxRate">
                          <el-input-number
                            v-model="item.taxRate"
                            placeholder="数字文本"
                            :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_taxRate')"
                            :step="0.01"
                            :precision="2"
                          />
                        </el-form-item>
                      </el-col>

                      <el-col :span="8" v-if="judgeShow('jnpf_zcgl_htgl_pab_fytk_jnpf_hsUnit')"
                      >
                        <el-form-item label="含税租金单价(元)"
                                      prop="hsUnitPrice"
                        >
                          <el-input-number v-model="item.hsUnitPrice"
                                           placeholder="数字文本"
                                           :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_hsUnit')"
                                           :step="0.01"
                                           :precision="2"
                          >
                          </el-input-number>
                        </el-form-item>
                      </el-col>

                      <el-col :span="8" v-if="judgeShow('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                      >
                        <el-form-item label="不含税租金单价(元)"
                                      prop="bhsUnitPrice"
                        >
                          <el-input-number v-model="item.bhsUnitPrice"
                                           placeholder="数字文本"
                                           :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                                           :step="0.01"
                                           :precision="2"
                          >
                          </el-input-number>
                        </el-form-item>
                      </el-col>


                    </el-row>

                    <el-row>
                      <el-col :span="8"
                      >
                        <el-form-item label="月租金(元)"
                                      :prop="getItemProp_zcgl_htgl_pab_fytk(index, 'monthlyRent')"
                        >
                          <el-input-number v-model="item.monthlyRent"
                                           placeholder="数字文本"
                                           :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                                           :step="0.01"
                                           :precision="2"
                          >
                          </el-input-number>
                        </el-form-item>
                      </el-col>

                      <el-col :span="8"
                      >
                        <el-form-item label="保证金(元)"
                                      :prop="getItemProp_zcgl_htgl_pab_fytk(index, 'earnestMoney')"
                        >
                          <el-input-number v-model="item.earnestMoney"
                                           placeholder="数字文本"
                                           :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                                           :step="0.01"
                                           :precision="2"
                          >
                          </el-input-number>
                        </el-form-item>
                      </el-col>

                      <el-col :span="8"
                      >
                        <el-form-item label="违约金(元)"
                                      :prop="getItemProp_zcgl_htgl_pab_fytk(index, 'jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                        >
                          <el-input-number v-model="item.defaultMoney"
                                           placeholder="数字文本"
                                           :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                                           :step="0.01"
                                           :precision="2"
                          >
                          </el-input-number>
                        </el-form-item>
                      </el-col>

                      <el-col style="display: flex" :span="8"
                              v-if="judgeShow('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                      >
                        <el-form-item label="付款周期(月)"
                                      placeholder="数字文本"
                                      :prop="getItemProp_zcgl_htgl_pab_fytk(index, 'paymentCycle')"

                        >
                          <el-input-number v-model="item.paymentCycle"
                                           :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                                           :step="1"
                          >
                          </el-input-number>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">

                        <el-form-item label="培育期"
                                      prop="ihis"
                        >
                          <el-switch
                            @change="changeTypeItem(index,item)"

                            v-model="item.isAvailable"
                            :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')" :active-value="1"
                            :inactive-value="0"
                          >

                          </el-switch>
                        </el-form-item>
                      </el-col>
                      <el-col :span="8">

                        <el-form-item v-if="item.isAvailable==1" label="优惠月数"
                                      prop="ihis"
                                      :prop="getItemProp_zcgl_htgl_pab_fytk(index, 'availableMonth')"
                        >
                          <el-input-number v-model="item.availableMonth"
                                           :step="1"
                          >
                          </el-input-number>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="8">

                        <el-form-item label="是否递增"
                                      prop="ihis"
                        >
                          <el-switch v-model="item.isIncreasing"
                                     :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')" :active-value="1"
                                     :inactive-value="0"
                          >

                          </el-switch>
                        </el-form-item>
                      </el-col>

                      <el-col :span="8">
                        &nbsp;
                      </el-col>
                      <el-col :span="8">
                        <el-form-item>

                          <el-button style="margin-left: 60%" type="danger" @click.prevent="removeFytk(index)">删除</el-button>
                        </el-form-item>
                      </el-col>
                    </el-row>



                    <!--递增条款-->
                    <div
                      style="background-color: #F5F7FA"
                      v-if="item.isIncreasing==1"
                      v-for="(item1, index) in dzForm.incrementList"
                      :key="index"
                      class="increment-item"
                    >
                      <el-row :gutter="16" class="item-row">
                        <el-col :span="8"  style="margin-top: 20px">
                          <el-form-item
                            disabled
                            label="递增开始时间"
                            class="form-item"
                            :prop="'incrementList.' + index + '.startTime'"
                            :rules="{ required: true, message: '请选择递增开始时间', trigger: 'change' }"
                          >
                            <el-date-picker
                              disabled
                              v-model="item1.startTime"
                              placeholder="请选择"
                              clearable
                              format="yyyy-MM-dd"
                              style="width: 100%;"
                            />
                          </el-form-item>
                        </el-col>
                        <el-col :span="8" style="margin-top: 20px">
                          <el-form-item
                            disabled
                            label="递增方式"
                            class="form-item"
                            :prop="'incrementList.' + index + '.dzType'"
                            :rules="{ required: true, message: '请选择递增方式', trigger: 'change' }"
                          >
                            <el-select
                              disabled
                              v-model="item1.dzType"
                              placeholder="请选择递增方式"

                              clearable
                              style="width: 100%;"
                              @change="handleDzTypeChange(item1, index)"
                            >
                              <el-option label="百分比" value="百分比"></el-option>
                              <el-option label="固定金额" value="固定金额"></el-option>
                            </el-select>
                          </el-form-item>
                        </el-col>
                        <el-col :span="8" style="margin-top: 20px">
                          <el-form-item
                            disabled
                            v-if="item1.dzType === '百分比'"
                            label="每周期递增"
                            class="form-item"
                            :prop="'incrementList.' + index + '.dz'"
                            :rules="{
                required: true,
                message: '请输入百分比',
                trigger: 'blur',
                pattern: /^[0-9]+(\.[0-9]{1,2})?$/,
                message: '请输入正确的百分比数值，最多两位小数'
              }"
                          >
                            <el-input
                              disabled
                              v-model.number="item1.dz"
                              placeholder="请输入百分比"
                              clearable
                              style="width: 100%;"
                            >
                              <template #append>%</template>
                            </el-input>
                          </el-form-item>
                          <el-form-item
                            disabled
                            v-if="item1.dzType === '固定金额'"
                            label="每月递增"
                            class="form-item"
                            :prop="'incrementList.' + index + '.dz'"
                            :rules="{
                required: true,
                message: '请输入元',
                trigger: 'blur',
                pattern: /(^[1-9]\d*(\.\d{1,2})?$)|(^0\.\d{1,2}$)/,
                message: '请输入正确的金额数值，最多两位小数'
              }"
                          >
                            <el-input
                              v-model.number="item1.dz"
                              placeholder="请输入金额"
                              disabled
                              clearable
                              style="width: 100%;"
                            >
                              <template #prepend>¥</template>
                            </el-input>
                          </el-form-item>
                        </el-col>
                      </el-row>
                      <el-row class="delete-row">
                        <el-col :span="24" class="delete-col">
                          <el-form-item class="form-item delete-btn-wrapper">
                            <el-button
                              icon="el-icon-delete"
                              type="danger"
                              @click="deleteIncrement(index)"
                              v-if="dzForm.incrementList.length > 1"
                            >
                              删除
                            </el-button>
                          </el-form-item>
                        </el-col>
                      </el-row>
                    </div>

                    <el-row  v-show="false">
                      <el-table
                        v-if="item.isIncreasing==1"
                        :data="item.listDz"
                        style="width: 100%"
                        border
                      >
                        <el-table-column
                          prop="start"
                          label="开始日期"
                        />
                        <el-table-column
                          prop="end"
                          label="结束日期"
                        />
                        <el-table-column
                          prop="rent"
                          label="租金单价"
                        />
                        <el-table-column
                          prop="yingshou"
                          label="应收金额"
                        />
                        <!--                        <el-table-column-->
                        <!--                          prop="paymentDate"-->
                        <!--                          label="付款日期"-->
                        <!--                          width="250"-->
                        <!--                        />-->
                        <el-table-column
                          v-if="dzForm.dzType=='百分比'"
                          prop="increasePercent"
                          label="递增(百分比)"
                        />

                        <el-table-column
                          v-if="dzForm.dzType=='固定金额'"
                          prop="increasePercent"
                          label="递增(元)"
                        />

                      </el-table>
                      <div v-if="item.isIncreasing==1" class="table-actions" @click="addzcglhtglpabspaceList()">
                        <el-button type="text" icon="el-icon-plus" @click="addDz(item)">批量新增递增条款</el-button>
                      </div>
                    </el-row>

                    <el-row>


                    </el-row>

                    <div v-if="item.isIncreasing==1" class="table-actions" @click="addzcglhtglpabspaceList()">
                      <el-button type="text" icon="el-icon-plus" @click="addDz(item)">批量新增递增条款</el-button>
                    </div>
                    <el-divider v-if="index < dataForm.zcgl_htgl_pab_fytk.length - 1"></el-divider>

                  </el-row>
                  <el-row>

                    <div class="table-actions" @click="addzcglhtglpabspaceList()">
                      <el-button type="text" icon="el-icon-plus" @click="addFytk">添加费用</el-button>
                    </div>

                  </el-row>
                </el-card>
              </el-col>


<!--              <el-col :span="24">-->
<!--                <el-card class="mb-20" shadow="always" header="其他费用条款">-->

<!--                  <el-row v-for="(item, index) in dataForm.zcgl_htgl_pab_qtfytk" :key="index">-->

<!--                      <el-col :span="8"-->
<!--                      >-->
<!--                        <el-form-item label="费用项"-->
<!--                                      :prop="getItemProp_zcgl_htgl_pab_qtfytk(index, 'expenseType')"-->

<!--                        >-->
<!--                          <el-select-->

<!--                            v-model="item.expenseType"-->
<!--                            clearable-->
<!--                            clearable :style='{"width":"80%"}'-->
<!--                          >-->
<!--                            <el-option-->
<!--                              label="房屋租金"-->
<!--                              value="1"-->
<!--                            ></el-option>-->
<!--                            <el-option-->
<!--                              label="物业"-->
<!--                              value="2"-->
<!--                            ></el-option>-->
<!--                          </el-select>-->
<!--                        </el-form-item>-->
<!--                      </el-col>-->

<!--                      <el-col :span="8"-->
<!--                      >-->
<!--                        <el-form-item label="起始日期"-->
<!--                                      prop="startTime"-->
<!--                        >-->
<!--                          <el-date-picker v-model="item.startTime"-->
<!--                                          @change="check(item)"-->
<!--                                          placeholder="请选择" clearable-->
<!--                                          :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"-->
<!--                          >-->

<!--                          </el-date-picker>-->
<!--&lt;!&ndash;                          :disabled="judgeWrite('startTime')"&ndash;&gt;-->
<!--&lt;!&ndash;                          :disabled="judgeWrite('endTime')"&ndash;&gt;-->
<!--                        </el-form-item>-->
<!--                      </el-col>-->

<!--                      <el-col :span="8"-->
<!--                      >-->
<!--                        <el-form-item label="结束日期"-->
<!--                                      :prop="getItemProp_zcgl_htgl_pab_qtfytk(index, 'endTime')"-->
<!--                        >-->
<!--                          <el-date-picker v-model="item.endTime"-->
<!--                                          @change="check(item)"-->
<!--                                          placeholder="请选择"  clearable-->
<!--                                          :style='{"width":"100%"}' type="date" format="yyyy-MM-dd"-->
<!--                          >-->

<!--                          </el-date-picker>-->
<!--                        </el-form-item>-->
<!--                      </el-col>-->
<!--                        <el-col :span="8"-->
<!--                        >-->
<!--                          <el-form-item label="月租金(元)"-->
<!--                                        :prop="getItemProp_zcgl_htgl_pab_qtfytk(index, 'money')"-->
<!--                          >-->
<!--                            <el-input-number v-model="item.money"-->
<!--                                             placeholder="数字文本"-->
<!--                                             :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"-->
<!--                                             :step="0.01"-->
<!--                                             :precision="2"-->
<!--                            >-->
<!--                            </el-input-number>-->
<!--                          </el-form-item>-->
<!--                        </el-col>-->


<!--                        <el-col style="display: flex" :span="8"-->
<!--                                v-if="judgeShow('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"-->
<!--                        >-->
<!--                          <el-form-item label="付款周期(月)"-->
<!--                                        placeholder="数字文本"-->
<!--                                        :prop="getItemProp_zcgl_htgl_pab_qtfytk(index, 'paymentCycle')"-->

<!--                          >-->
<!--                            <el-input-number v-model="item.paymentCycle"-->
<!--                                             :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"-->
<!--                                             :step="1"-->
<!--                            >-->
<!--                            </el-input-number>-->
<!--                          </el-form-item>-->
<!--                        </el-col>-->
<!--                        <el-col :span="8">-->
<!--                          <el-form-item>-->
<!--                            <el-button  style="margin-left: 60%" type="danger" @click.prevent="removeFyQttk(index)">删除</el-button>-->
<!--                          </el-form-item>-->
<!--                        </el-col>-->


<!--                      <el-divider v-if="index < dataForm.zcgl_htgl_pab_qtfytk.length - 1"></el-divider>-->

<!--&lt;!&ndash;                    <el-row>加了这个不得行&ndash;&gt;-->


<!--&lt;!&ndash;                    </el-row>&ndash;&gt;-->


<!--                  </el-row>-->
<!--                  <div class="table-actions" @click="addzcglhtglpabspaceList()">-->
<!--                    <el-button type="text" icon="el-icon-plus" @click="addFyQtTk">添加其他费用</el-button>-->
<!--                  </div>-->
<!--                </el-card>-->
<!--              </el-col>-->


            </div>

            <div v-if="active==2">
              <el-card class="mb-20" shadow="always" header="乙方">
                <el-col :span="24" v-if="judgeShow('zcglhtglpabList') && formOperates">
                  <el-form-item label-width="0">
                    <div class="JNPF-common-title">
                      <h2></h2>
                    </div>

                    <div v-for="(item, index) in skjh" :key="index">
                      <el-table
                        :data="item.listSk"
                        :span-method="objectSpanMethod"
                        style="width: 100%"
                        border
                      >
                        <el-table-column
                          prop="relatedSpace"
                          label="资产名称"
                          width="250"
                          fixed
                        />
                        <el-table-column
                          prop="expenseItem"
                          label="费用项"
                          width="222"
                        />


                        <el-table-column
                          prop="intervall"
                          label="周期"
                          width="222"
                        />
                        <el-table-column
                          prop="paymentDate"
                          label="付款日期"
                          width="222"
                        />

                        <el-table-column
                          prop="monthlyRent"
                          label="月租金(元)"
                          width="155"
                        />
                        <el-table-column
                          prop="inclusiveAmount"
                          label="应收金额(元)"
                          width="155"
                        />
<!--                        <el-table-column-->
<!--                          prop="excludingAmount"-->
<!--                          label="不含税金额(元)"-->
<!--                          width="222"-->
<!--                        />-->
<!--                        <el-table-column-->
<!--                          prop="taxRate"-->
<!--                          label="税率(%)"-->
<!--                          width="80"-->
<!--                        />-->
                      </el-table>
                    </div>

                  </el-form-item>
                </el-col>
              </el-card>

            </div>
            <div v-if="active==3">
              <el-card class="mb-20" shadow="always" header="收款账户">
                <el-col :span="24" v-if="judgeShow('zcglhtglpabList') && formOperates">
                  <el-form-item label-width="0">
                    <div class="JNPF-common-title">
                      <h2></h2>
                    </div>
                    <el-table :data="dataForm.zcgl_htgl_qtskzhs" size="mini">
                      <el-table-column type="index" width="80" label="序号" align="center"/>

                      <el-table-column prop="pabContactNumber" label="费用项"
                                       v-if="judgeShow('zcglhtglpabList-pabContactNumber')"
                      >
                        <template slot="header" v-if="judgeRequired('zcglhtglpabList-pabContactNumber')">
                          <span class="required-sign">*</span>费用项
                        </template>
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.expenseItem"
                                    placeholder="请输入"
                                    :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabContactNumber')"
                                    clearable :style='{"width":"100%"}'
                          >
                          </el-input>
                        </template>
                      </el-table-column>


                      <el-table-column prop="pabIdNo" label="户名" v-if="judgeShow('zcglhtglpabList-pabIdNo')"
                      >
                        <template slot="header" v-if="judgeRequired('zcglhtglpabList-pabIdNo')">
                          <span class="required-sign">*</span>户名
                        </template>
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.accountName"
                                    placeholder="请输入"
                                    :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabIdNo')"
                                    clearable :style='{"width":"100%"}'
                          >
                          </el-input>
                        </template>
                      </el-table-column>

                      <el-table-column prop="pabContactAddress" label="开户银行"
                                       v-if="judgeShow('zcglhtglpabList-pabContactAddress')"
                      >
                        <template slot="header" v-if="judgeRequired('zcglhtglpabList-pabContactAddress')">
                          <span class="required-sign">*</span>开户银行
                        </template>
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.bankDeposit"
                                    placeholder="请输入"
                                    :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabContactAddress')"
                                    clearable :style='{"width":"100%"}'
                          >
                          </el-input>
                        </template>
                      </el-table-column>
                      <el-table-column prop="pabIdNo" label="账号" v-if="judgeShow('zcglhtglpabList-pabIdNo')"
                      >
                        <template slot="header" v-if="judgeRequired('zcglhtglpabList-pabIdNo')">
                          <span class="required-sign">*</span>账号
                        </template>
                        <template slot-scope="scope">
                          <el-input v-model="scope.row.accountNumber"
                                    placeholder="请输入"
                                    :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabIdNo')"
                                    clearable :style='{"width":"100%"}'
                          >
                          </el-input>
                        </template>
                      </el-table-column>
                      <el-table-column label="操作" width="60"
                                       v-if="!setting.readonly && !judgeWrite('zcglhtglpabList')"
                      >
                        <template slot-scope="scope">
                          <el-button size="mini" type="text" class="JNPF-table-delBtn"
                                     @click="delzcglhtglpabList(scope.$index)"
                          >删除
                          </el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                    <div class="table-actions" @click="addzcgl_htgl_qtskzhList()">
                      <el-button type="text" icon="el-icon-plus">添加</el-button>
                    </div>
                  </el-form-item>
                </el-col>
              </el-card>


              <el-card class="mb-20" shadow="always" header="其他条款">
                <el-col :span="24" v-if="judgeShow('zcglhtglpabList') && formOperates">
                  <el-form-item label-width="0">
                    <div class="JNPF-common-title">
                      <h2></h2>
                    </div>
                    <el-table :data="dataForm.zcgl_htgl_qtydtks" size="mini">
                      <el-table-column type="index" width="80" label="序号" align="center"/>

                      <el-table-column prop="pabContactNumber" label="条款"
                                       v-if="judgeShow('zcglhtglpabList-pabContactNumber')"
                      >
                        <template slot="header" v-if="judgeRequired('zcglhtglpabList-pabContactNumber')">
                          <span class="required-sign">*</span>条款
                        </template>
                        <template slot-scope="scope">
                          <el-input type="textarea" v-model="scope.row.clauseContent"
                                    placeholder="请输入"
                                    :disabled="judgeWrite('zcglhtglpabList') || judgeWrite('zcglhtglpabList-pabContactNumber')"
                                    clearable :style='{"width":"100%"}'
                          >
                          </el-input>
                        </template>
                      </el-table-column>


                      <el-table-column label="操作" width="60"
                                       v-if="!setting.readonly && !judgeWrite('zcglhtglpabList')"
                      >
                        <template slot-scope="scope">
                          <el-button size="mini" type="text" class="JNPF-table-delBtn"
                                     @click="delzcglhtglpabList(scope.$index)"
                          >删除
                          </el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                    <div class="table-actions" @click="addzcgl_htgl_qtydtkList()">
                      <el-button type="text" icon="el-icon-plus">添加</el-button>
                    </div>
                  </el-form-item>
                </el-col>
              </el-card>
            </div>

          </el-col>
        </template>
      </el-form>
    </el-row>
    <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit"/>

    <el-dialog
      title="新建递增计划"
      :visible.sync="dzDialog"
      width="900px"
      class="JNPF-dialog JNPF-dialog_center transfer-dialog"
      lock-scroll
      append-to-body
      :modal-append-to-body="false"
      @close="onClose"
    >
      <el-form
        ref="elForm"
        :model="dzForm"
        size="medium"
        label-width="120px"
        class="custom-form"
      >
        <!-- 动态列表区域 -->
        <div
          v-for="(item, index) in dzForm.incrementList"
          :key="index"
          class="increment-item"
        >
          <el-row :gutter="16" class="item-row">
            <el-col :span="8">
              <el-form-item
                label="递增开始时间"
                class="form-item"
                :prop="'incrementList.' + index + '.startTime'"
                :rules="{ required: true, message: '请选择递增开始时间', trigger: 'change' }"
              >
                <el-date-picker
                  v-model="item.startTime"
                  placeholder="请选择"
                  clearable
                  format="yyyy-MM-dd"
                  style="width: 100%;"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                label="递增方式"
                class="form-item"
                :prop="'incrementList.' + index + '.dzType'"
                :rules="{ required: true, message: '请选择递增方式', trigger: 'change' }"
              >
                <el-select
                  v-model="item.dzType"
                  placeholder="请选择递增方式"
                  :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                  clearable
                  style="width: 100%;"
                  @change="handleDzTypeChange(item, index)"
                >
                  <el-option label="百分比" value="百分比"></el-option>
                  <el-option label="固定金额" value="固定金额"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item
                v-if="item.dzType === '百分比'"
                label="每周期递增"
                class="form-item"
                :prop="'incrementList.' + index + '.dz'"
                :rules="{
                required: true,
                message: '请输入百分比',
                trigger: 'blur',
                pattern: /^[0-9]+(\.[0-9]{1,2})?$/,
                message: '请输入正确的百分比数值，最多两位小数'
              }"
              >
                <el-input
                  v-model.number="item.dz"
                  placeholder="请输入百分比"
                  :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                  clearable
                  style="width: 100%;"
                >
                  <template #append>%</template>
                </el-input>
              </el-form-item>
              <el-form-item
                v-if="item.dzType === '固定金额'"
                label="每月递增"
                class="form-item"
                :prop="'incrementList.' + index + '.dz'"
                :rules="{
                required: true,
                message: '请输入元',
                trigger: 'blur',
                pattern: /(^[1-9]\d*(\.\d{1,2})?$)|(^0\.\d{1,2}$)/,
                message: '请输入正确的金额数值，最多两位小数'
              }"
              >
                <el-input
                  v-model.number="item.dz"
                  placeholder="请输入金额"
                  :disabled="judgeWrite('jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit')"
                  clearable
                  style="width: 100%;"
                >
                  <template #prepend>¥</template>
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="delete-row">
            <el-col :span="24" class="delete-col">
              <el-form-item class="form-item delete-btn-wrapper">
                <el-button
                  icon="el-icon-delete"
                  type="danger"
                  @click="deleteIncrement(index)"
                  v-if="dzForm.incrementList.length > 1"
                >
                  删除
                </el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </div>

        <!-- 添加按钮 -->
        <el-form-item class="form-item add-btn-wrapper">
          <el-button
            icon="el-icon-plus"
            type="primary"
            @click="addIncrement"
          >
            添加递增项
          </el-button>
        </el-form-item>

        <!-- 确定提交按钮 -->
        <el-form-item class="form-item">
          <el-button type="primary" @click="submitDz">确定</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>


    <!-- 固定在底部的按钮列 -->
    <div class="fixed-bottom">

      <button v-if="active!=0" class="confirm-button" @click="nextS">上一步</button>
      <button v-if="(active!=3 && active!=1) || (setting.readonly && active!=3) " class="confirm-button" @click="next">
        下一步
      </button>
      <button class="confirm-button" v-if="active == 1 && !setting.readonly" @click="createSk">生成收款计划</button>

    </div>
  </div>
</template>
<script>
import request from '@/utils/request'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import Popup from './PopupSelect'
import PrintBrowse from '@/components/PrintBrowse'
import ElTreeSelect from '@/components/JNPF-treeSelect'
import Vue from '../../../../public/cdn/tinymce/tinymce.min'

export default {
  components: {ElTreeSelect, Popup},
  props: [],
  data() {
    return {

      active: 0,
      dzItem: {},
      // dzForm: {},
      dzForm: {
        incrementList: [
          // {
          //   startTime: null,
          //   dzType: "百分比",
          //   dz: "",
          // },
        ],
      },
      dzDialog: false,
      spanArr: [], // 用于合并单元格的数组
      position: 0, // 用于记录位置
      skjh: [],
      lastmodifytimecolumnOptions: [

        {
          value: 'zcname',
          label: '资产名称'
        }

        ,
        {
          value: 'zcnumber',
          label: '资产编码'
        },

        {
          value: 'address',
          label: '地址'
        },
        {
          value: 'buildingmeasurementarea',
          label: '建筑测量面积'
        }
      ],

      kfList: [],
      visible: false,
      loading: false,
      setting: {},
      eventType: '',
      userBoxVisible: false,
      currTableConf: {},
      addTableConf: {
        zcglhtglpabspaceList: {
          'popupType': 'dialog',
          'hasPage': true,
          'popupTitle': '选择数据',
          'pageSize': 20,
          'columnOptions': [],
          'interfaceId': '',
          'interfaceName': '',
          'relationOptions': [],
          'templateJson': [],
          'popupWidth': '800px'
        }

      },
      tableRows: {
        zcglhtglpabList: {
          pabContactNumber: '',
          pabIdNo: '',
          pabContactAddress: '',
          enabledmark: undefined
        },
        zcglhtglpabspaceList: {
          spaceName: '',
          operatingArea: '',
          spaceType: '',
          rentalStatus: '',
          enabledmark: undefined
        }
      },
      dataForm: {
        id: '',
        flowId: '',
        isLongTermPlace: '是',
        status: 1,
        freeapproveruserid: '',
        flowUrgent: 1,
        htType: undefined,
        contractNumber: undefined,
        nbContractNumber: undefined,
        contractPeriod: undefined,
        advancePaymentDays: undefined,
        contractType: undefined,
        project: undefined,
        relatedContracts: undefined,
        signingDate: undefined,
        effectiveDate: undefined,
        purposeHouse: undefined,
        contractHandler: undefined,
        ihis: 0,
        notes: undefined,
        partyName: undefined,
        partyBusinessLicense: undefined,
        partyContacts: undefined,
        partyContactInformation: undefined,
        startTime: undefined,
        endTime: undefined,
        paymentDeadlineType: undefined,
        paymentDeadline: undefined,
        paymentDeadlineStatus: undefined,
        paymentZdrq: undefined,
        rentalArea: 0,
        zcgl_htgl_pab: [],
        zcgl_htgl_pab_space1: [],
        zcgl_htgl_qtskzhs: [],
        zcgl_htgl_qtydtks: [],
        zcglhtglpabspaceList: [],
        zcgl_htgl_pab_qtfytk:[{

          startTime: null,
          endTime: '',
          paymentCycle:1,
          expenseType:'',
          money:''
        }],
        zcgl_htgl_pab_fytk:
          [{
            startTime: '',
            endTime: '',
            taxRate: '',
            hsUnit: '',
            bhsUnit: '1',
            relatedSpace: '',
            bhsUnitPrice: 0.00,
            hsUnitPrice: 0.00,
            earnestMoney: 0.00,
            defaultMoney: 0.00,
            monthlyRent: 0.00,
            paymentCycle: 1,
          }],
        jnpf_zcgl_htgl_pab_fytk_jnpf_startTime: '',
        jnpf_zcgl_htgl_pab_fytk_jnpf_endTime: '',
        jnpf_zcgl_htgl_pab_fytk_jnpf_taxRate: '',
        jnpf_zcgl_htgl_pab_fytk_jnpf_hsUnit: '',
        jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit: ''
      },
      tableRequiredData: {},
      activezizgbo: '0',
      dataRule:
        {
          // zcgl_htgl_pab_fytk: [
          //   {
          //     monthlyRent: [
          //       { required: true, message: '请输入月租金', trigger: 'blur' },
          //       {
          //         validator: (rule, value, callback) => {
          //           if (!value || value.trim() === '') {
          //             callback(new Error('月租金不能为空'));
          //           } else {
          //             callback();
          //           }
          //         },
          //         trigger: 'blur',
          //       },
          //     ],
          //   },
          //   ],
          'title': [{'required': true, 'message': '流程标题不能为空', 'trigger': 'blur'}],
          'contractNumber': [{'required': true, 'message': '合同编号不能为空', 'trigger': 'blur'}],
          'contractType': [{'required': true, 'message': '合同类型不能为空', 'trigger': 'blur'}],
          'signingDate': [{'required': true, 'message': '签订日期不能为空', 'trigger': 'blur'}],
          'effectiveDate': [{'required': true, 'message': '生效日期不能为空', 'trigger': 'blur'}],
          'partyName': [{'required': true, 'message': '甲方名称不能为空', 'trigger': 'blur'}],
          'partyContacts': [{'required': true, 'message': '甲方联系人不能为空', 'trigger': 'blur'}],
          'partyContactInformation': [{'required': true, 'message': '甲方联系方式不能为空', 'trigger': 'blur'}],
          'startTime': [{'required': true, 'message': '合同起始日期不能为空', 'trigger': 'blur'}],
          // 'endTime': [{'required': true, 'message': '合同结束日期不能为空', 'trigger': 'blur'}],
          'paymentDeadlineType': [{'required': true, 'message': '交费期限类型不能为空', 'trigger': 'blur'}],
          'paymentDeadline': [{'required': true, 'message': '交费期限日不能为空', 'trigger': 'blur'}],
          'jnpf_zcgl_htgl_pab_fytk_jnpf_startTime': [{'required': true, 'message': '租金开始日期不能为空', 'trigger': 'blur'}],
          'jnpf_zcgl_htgl_pab_fytk_jnpf_endTime': [{'required': true, 'message': '租金结束日期不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.0.relatedSpace': [{'required': true, 'message': '关联资产不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.relatedSpace': [{'required': true, 'message': '关联资产不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.relatedSpace': [{'required': true, 'message': '关联资产不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.relatedSpace': [{'required': true, 'message': '关联资产不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.0.monthlyRent': [{'required': true, 'message': '月租金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.monthlyRent': [{'required': true, 'message': '月租金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.monthlyRent': [{'required': true, 'message': '月租金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.monthlyRent': [{'required': true, 'message': '月租金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.0.earnestMoney': [{'required': true, 'message': '保证金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.earnestMoney': [{'required': true, 'message': '保证金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.earnestMoney': [{'required': true, 'message': '保证金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.earnestMoney': [{'required': true, 'message': '保证金不能为空', 'trigger': 'blur'}],

          'zcgl_htgl_pab_fytk.0.expenseType': [{'required': true, 'message': '计租方式不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.expenseType': [{'required': true, 'message': '计租方式不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.expenseType': [{'required': true, 'message': '计租方式不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.expenseType': [{'required': true, 'message': '计租方式不能为空', 'trigger': 'blur'}],


          'zcgl_htgl_pab.0.pabCustomerName': [{'required': true, 'message': '乙方客户名称0不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab.0.pabContactNumber': [{'required': true, 'message': '乙方客户电话0不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab.1.pabContactNumber': [{'required': true, 'message': '乙方客户电话1不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab.1.pabCustomerName': [{'required': true, 'message': '乙方客户名称1不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab.2.pabCustomerName': [{'required': true, 'message': '乙方客户名称2不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab.3.pabCustomerName': [{'required': true, 'message': '乙方客户名称3不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab.2.pabContactNumber': [{'required': true, 'message': '乙方客户电话2不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab.3.pabContactNumber': [{'required': true, 'message': '乙方客户电话3不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.0.rentMethod': [{'required': true, 'message': '费用类别0不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.rentMethod': [{'required': true, 'message': '费用类别1不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.rentMethod': [{'required': true, 'message': '费用类别2不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.rentMethod': [{'required': true, 'message': '费用类别3不能为空', 'trigger': 'blur'}],
          // 'zcgl_htgl_pab_fytk.0.expenseType': [{'required': true, 'message': '租金类别0不能为空', 'trigger': 'blur'}],
          // 'zcgl_htgl_pab_fytk.1.expenseType': [{'required': true, 'message': '租金类别1不能为空', 'trigger': 'blur'}],
          // 'zcgl_htgl_pab_fytk.2.expenseType': [{'required': true, 'message': '租金类别2不能为空', 'trigger': 'blur'}],
          // 'zcgl_htgl_pab_fytk.3.expenseType': [{'required': true, 'message': '租金类别3不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.0.startTime': [{'required': true, 'message': '开始日期1不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.startTime': [{'required': true, 'message': '开始日期2不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.startTime': [{'required': true, 'message': '开始日期3不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.startTime': [{'required': true, 'message': '开始日期4不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.0.endTime': [{'required': true, 'message': '结束日期1不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.endTime': [{'required': true, 'message': '结束日期2不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.endTime': [{'required': true, 'message': '结束日期3不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.endTime': [{'required': true, 'message': '结束日期4不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.0.cycleDivisionMethod': [{'required': true, 'message': '周期划分方式1不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.cycleDivisionMethod': [{'required': true, 'message': '周期划分方式2不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.cycleDivisionMethod': [{'required': true, 'message': '周期划分方式3不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.cycleDivisionMethod': [{'required': true, 'message': '周期划分方式4不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.0.paymentCycle': [{'required': true, 'message': '付款周期1不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.paymentCycle': [{'required': true, 'message': '付款周期2不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.paymentCycle': [{'required': true, 'message': '付款周期3不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.paymentCycle': [{'required': true, 'message': '付款周期4不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.0.paymentType': [{'required': true, 'message': '收款日1不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.1.paymentType': [{'required': true, 'message': '收款日2不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.2.paymentType': [{'required': true, 'message': '收款日3不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_fytk.3.paymentType': [{'required': true, 'message': '收款日4不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.0.startTime': [{'required': true, 'message': '开始时间不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.1.startTime': [{'required': true, 'message': '开始时间不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.2.startTime': [{'required': true, 'message': '开始时间不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.3.startTime': [{'required': true, 'message': '开始时间不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.0.endTime': [{'required': true, 'message': '结束时间不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.1.endTime': [{'required': true, 'message': '结束时间不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.2.endTime': [{'required': true, 'message': '结束时间不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.3.endTime': [{'required': true, 'message': '结束时间不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.0.expenseType': [{'required': true, 'message': '费用项目不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.1.expenseType': [{'required': true, 'message': '费用项目不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.2.expenseType': [{'required': true, 'message': '费用项目不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.3.expenseType': [{'required': true, 'message': '费用项目不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.0.money': [{'required': true, 'message': '月租金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.1.money': [{'required': true, 'message': '月租金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.2.money': [{'required': true, 'message': '月租金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.3.money': [{'required': true, 'message': '月租金不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.0.paymentCycle': [{'required': true, 'message': '付款周期不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.1.paymentCycle': [{'required': true, 'message': '付款周期不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.2.paymentCycle': [{'required': true, 'message': '付款周期不能为空', 'trigger': 'blur'}],
          'zcgl_htgl_pab_qtfytk.3.paymentCycle': [{'required': true, 'message': '付款周期不能为空', 'trigger': 'blur'}]

        },
      contractTypeOptions: [],
      projectOptions: [],
      relatedContractsOptions: [{'fullName': '选项一', 'id': '1'}, {'fullName': '选项二', 'id': '2'}],
      partyNameOptions: [{'fullName': '选项一', 'id': '1'}, {'fullName': '选项二', 'id': '2'}],
      paymentDeadlineTypeOptions: [],
      htTypeOptions: [{'fullName': '无固定期限', 'id': '1'}, {'fullName': '固定期限', '固定期限': '2'}],
      paymentDeadlineStatusOptions: [],

      pabCustomerNameOptions: [{'fullName': '选项一', 'id': '1'}, {'fullName': '选项二', 'id': '2'}],
      pabIdTypeOptions: [{'fullName': '选项一', 'id': '1'}, {'fullName': '选项二', 'id': '2'}]
    }
  },

  watch: {},
  created() {
    this.getcontractTypeOptions()
    this.getprojectOptions()
    this.getpaymentDeadlineTypeOptions()
    this.getpaymentDeadlineStatusOptions()
    this.getKhList()
    this.getHtNumber()
  },
  mounted() {
  },
  computed: {
    formOperates() {
      return this.setting.formOperates
    },
    // 将递增项列表按每3个一组进行分组，用于一行显示3个
    groupedIncrementList() {
      const list = this.dzForm.incrementList;
      const result = [];
      for (let i = 0; i < list.length; i += 3) {
        result.push(list.slice(i, i + 3));
      }
      return result;
    }
  },
  methods: {
    // 重置表单
    resetForm() {
      this.dzForm.incrementList = [
        {
          startTime: null,
          dzType: "百分比",
          dz: "",
        },
      ];
      if (this.$refs.elForm) {
        this.$refs.elForm.resetFields();
      }
    },

    // 添加递增项
    addIncrement() {
      var firstType = "百分比"
      // 获取第一个递增项的递增方式，确保新增项与之保持一致
      if(this.dzForm.incrementList.length>0){
        firstType = this.dzForm.incrementList[0].dzType ;
      }


      this.dzForm.incrementList.push({
        startTime: null,
        dzType: firstType,
        dz: "",
      });
    },

    // 删除递增项
    deleteIncrement(index) {
      this.dzForm.incrementList.splice(index, 1);
    },

    // 递增方式改变时处理
    handleDzTypeChange(item, index) {
      // 当第一项的递增方式改变时，同步更新所有后续项的递增方式
      if (index === 0) {
        const newType = item.dzType;
        this.dzForm.incrementList.forEach((item, i) => {
          if (i > 0) {
            item.dzType = newType;
            item.dz = ""; // 清空其他项的值
          }
        });
      }

      // 触发表单校验
      this.$refs.elForm.validateField(`incrementList.${index}.dz`);
    },
    changeTypeItem(index, item) {

      if (item.isAvailable == '0') {
        this.removeEndTimeRequiredRule()
      } else {
        this.addAvailableMonth(index, item)

      }
    },
    addAvailableMonth(index, item) {
      const newDataRule = {...this.dataRule};

      newDataRule['zcgl_htgl_pab_fytk.' + index + '.availableMonth'] = [{
        'required': true,
        'message': '优惠月数不能为空',
        'trigger': 'blur'
      }],
        this.$set(this, 'dataRule', newDataRule);
    },
    removeEndTimeRequiredRule(dataRule) {
      const newDataRule = {...this.dataRule};
      delete newDataRule.endTime;
      this.$set(this, 'dataRule', newDataRule);
      this.$forceUpdate()
      this.$refs.elForm.clearValidate('endTime');
    },
    addEndTimeRequiredRule(dataRule) {
      const newDataRule = {...this.dataRule};
      newDataRule.endTime = [{'required': true, 'message': '合同结束日期不能为空', 'trigger': 'blur'}],
        this.$set(this, 'dataRule', newDataRule);
    },
    changeItemType() {
      if (this.dataForm.contractType == '无固定期限') {
        this.removeEndTimeRequiredRule()
      } else {
        this.addEndTimeRequiredRule()

      }
    },
    changeType() {
      if (this.dataForm.contractType == '无固定期限') {
        this.removeEndTimeRequiredRule()
      } else {
        this.addEndTimeRequiredRule()

      }
    },

    check(item) {

      if (item.endTime != null && new Date(item.endTime) < new Date(item.startTime)) {
        this.$message({
          message: '结束时间不能小于开始时间，请重新设置！',
          type: 'error',
          duration: 1000
        })
        // 不设置结束时间
        item.endTime = null;
        return
      }
    },
    toMethod(item) {
      if (item.cycleDivisionMethod == '1') {


        item.paymentCycle = 3
      }
    },

    getItemProp(index, prop) {
      // return `zcgl_htgl_pab[${index}].${prop}`
      return `zcgl_htgl_pab.${index}.${prop}`
    },
    getItemProp_zcgl_htgl_pab_fytk(index, prop) {
      // return `zcgl_htgl_pab[${index}].${prop}`
      return `zcgl_htgl_pab_fytk.${index}.${prop}`
    },
    getItemProp_zcgl_htgl_pab_qtfytk(index, prop) {
      // return `zcgl_htgl_pab[${index}].${prop}`
      return `zcgl_htgl_pab_qtfytk.${index}.${prop}`
    },


    nextS() {

      if (this.active-- < 1) this.active = 0
    },

    next() {

      if (this.active++ > 2) this.active = 3

      this.$forceUpdate()
      this.updateDataRule()
    },
    // 格式化日期
    formatDate(date) {
      if (!date) return '';
      const d = new Date(date);
      const year = d.getFullYear();
      const month = String(d.getMonth() + 1).padStart(2, '0');
      const day = String(d.getDate()).padStart(2, '0');
      return `${year}-${month}-${day}`;
    },


    // 提交表单并生成应收列表
    submitDz() {
      this.$refs.elForm.validate((valid) => {
        if (valid) {
          // 验证递增开始时间是否为周期的第一个月
          if (!this.validateIncrementTimes()) {
            return;
          }

          if (this.dataForm.contractType === '无固定期限') {
            // 无固定期限合同处理逻辑
            // 计算20年后的时间戳
            const twentyYearsInMillis = 10 * 365 * 24 * 60 * 60 * 1000;
            this.dataForm.endTime = this.dataForm.startTime + twentyYearsInMillis;
          } else {

          }


          // 检查合同时间和租金信息
          if (!this.dataForm.startTime || !this.dataForm.endTime) {
            this.$message.error('请先设置合同开始和结束时间');
            return;
          }

          if (this.dzItem.monthlyRent <= 0) {
            this.$message.error('请设置月租金');
            return;
          }

          if (this.dzItem.paymentCycle <= 0) {
            this.$message.error('请设置付款周期');
            return;
          }

          // 生成应收列表
          this.generateIntervals();

          // 提交成功后关闭弹窗
          this.onClose();

          // 显示生成的应收列表（可根据需求调整）
          console.log('生成的应收列表:', this.intervals);
          for (let i = 0; i < this.dataForm.zcgl_htgl_pab_fytk.length; i++) {

                if (this.dzItem.relatedSpace == this.dataForm.zcgl_htgl_pab_fytk[i].relatedSpace) {

                  this.dataForm.zcgl_htgl_pab_fytk[i].listDz = this.intervals

                }

              }
          this.$message.success('应收列表生成成功');
        } else {
          console.log("表单校验不通过");
        }
      });
    },
    // 日期增加月份
    addMonths(date, months) {
      const d = new Date(date);
      d.setMonth(d.getMonth() + months);
      return d;
    },

    // 生成应收列表
    generateIntervals() {
      // 对递增规则按开始时间排序
      const sortedIncrements = [...this.dzForm.incrementList]
        .filter(item => item.startTime)
        .sort((a, b) => new Date(a.startTime) - new Date(b.startTime));

      // 添加合同开始和结束时间
      sortedIncrements.unshift({ startTime: this.dataForm.startTime });
      sortedIncrements.push({ startTime: this.dataForm.endTime });

      // 初始化结果数组
      this.intervals = [];

      // 当前租金
      let currentRent = this.dzItem.monthlyRent;

      // 处理每个递增区间
      for (let i = 0; i < sortedIncrements.length - 1; i++) {
        const startDate = new Date(sortedIncrements[i].startTime);
        const endDate = new Date(sortedIncrements[i + 1].startTime);

        // 应用递增规则（从第二个区间开始）
        if (i > 0) {
          const increment = sortedIncrements[i];
          if (increment.dzType === '百分比') {
            currentRent += currentRent * (increment.dz / 100);
          } else {
            currentRent += increment.dz;
          }
        }

        // 计算区间内的付款周期
        let currentStart = new Date(startDate);
        while (true) {
          // 计算当前周期的结束日期
          let currentEnd = this.addMonths(currentStart, this.dzItem.paymentCycle);

          // 如果超过合同结束时间，调整为合同结束时间
          if (currentEnd > endDate) {
            currentEnd = new Date(endDate);
          }

          // 添加到应收列表
          this.intervals.push({
            start: this.formatDate(currentStart),
            end: this.formatDate(currentEnd),
            paymentDate: null,
            yingshou: (currentRent * this.dzItem.paymentCycle).toFixed(2),
            rent: currentRent.toFixed(2),
            increasePercent: i > 0 ? sortedIncrements[i].dz : 0
          });

          // 如果已到达区间结束，退出循环
          if (currentEnd >= endDate) {
            break;
          }

          // 移动到下一个周期
          currentStart = new Date(currentEnd);
        }
      }
    },
// 验证递增开始时间是否为周期的第一个月
    // 验证递增开始时间是否为周期的第一个月
    validateIncrementTimes() {
      const contractStart = new Date(this.dataForm.startTime);
      const contractEnd = new Date(this.dataForm.endTime);
      const paymentCycle = this.dzItem.paymentCycle;

      // 对递增规则按开始时间排序
      const sortedIncrements = [...this.dzForm.incrementList]
        .filter(item => item.startTime)
        .sort((a, b) => new Date(a.startTime) - new Date(b.startTime));

      // 检查每个递增时间是否符合周期要求
      for (const increment of sortedIncrements) {
        const incrementDate = new Date(increment.startTime);

        // 检查递增时间是否在合同期内
        if (incrementDate < contractStart || incrementDate > contractEnd) {
          this.$message.error(`递增开始时间必须在合同期内（${this.formatDate(contractStart)}至${this.formatDate(contractEnd)}）`);
          return false;
        }

        // 计算与合同开始时间的月份差
        const monthDiff =
          (incrementDate.getFullYear() - contractStart.getFullYear()) * 12 +
          (incrementDate.getMonth() - contractStart.getMonth());

        // 检查是否为周期的整数倍
        if (monthDiff % paymentCycle !== 0) {
          this.$message.error(`递增开始时间必须是付款周期的整数倍月份：${paymentCycle}个月`);
          return false;
        }

        // 检查日期是否为每月第一天
        if (incrementDate.getDate() !== 1) {
          this.$message.error(`递增开始时间必须是每月的第一天`);
          return false;
        }
      }

      return true;
    },
    // submitDz() {
    //
    //   this.$refs.elForm.validate((valid) => {
    //     if (valid) {
    //       // 处理提交逻辑
    //       console.log("提交的数据：", this.dzForm.incrementList);
    //       // 提交成功后关闭弹窗
    //       this.onClose();
    //     } else {
    //       console.log("表单校验不通过");
    //     }
    //   });
    //
    //
    //
    //   const contractStartTime = new Date(this.dataForm.startTime); // 合同开始时间
    //
    //   let contractEndTime;
    //   if (this.dataForm.contractType == '无固定期限') {
    //     const newDate = new Date(contractStartTime);
    //     newDate.setFullYear(newDate.getFullYear() + 20);
    //     contractEndTime = newDate;
    //   } else {
    //     contractEndTime = new Date(this.dataForm.endTime); // 合同结束时间
    //   }
    //
    //
    //   const paymentCycle = parseInt(this.dzItem.paymentCycle) // 付款周期，单位：月
    //
    //
    //   if(paymentCycle == 0){
    //
    //     this.$message({
    //       message: '付款周期不能为0！',
    //       type: 'error',
    //       duration: 1000
    //     })
    //     return
    //
    //   }
    //
    //
    //   // const paymentType = this.dzItem.paymentType // '账单开始前' 或 '账单开始后'
    //   const monthlyRent = parseFloat(this.dzItem.monthlyRent) // 月租金
    //   // const paymentDays = parseInt(this.dzItem.paymentDays) // 付款天数
    //   const dzStartTime = new Date(this.dzForm.startTime) // 递增开始时间
    //   const dzPercent = parseFloat(this.dzForm.dz) / 100 // 递增百分比，转换为小数
    //
    //   // 计算所有可能的递增开始日期
    //   let possibleDzStartTimes = []
    //   possibleDzStartTimes.push(this.formatDate(contractStartTime))
    //   let tempDate = new Date(contractStartTime)
    //   while (tempDate < contractEndTime) {
    //
    //     tempDate.setMonth(tempDate.getMonth() + paymentCycle)
    //     if (tempDate <= contractEndTime) {
    //
    //       possibleDzStartTimes.push(this.formatDate(new Date(tempDate)))
    //     }
    //   }
    //   // 检查用户输入的递增开始日期是否在可能的日期列表中
    //   let valid = false
    //   for (let date of possibleDzStartTimes) {
    //     if (this.formatDate(new Date(dzStartTime)) == date) {
    //       valid = true
    //       break
    //     }
    //   }
    //   if (!valid) {
    //     this.$message({
    //       message: '递增开始日期必须是合同开始日期加上付款周期后的第一天',
    //       type: 'error',
    //       duration: 1000
    //     })
    //     return
    //   }
    //
    //   const intervals = []
    //   let currentStart = new Date(contractStartTime)
    //   let currentRent = monthlyRent // 当前租金
    //
    //   while (currentStart < contractEndTime) {
    //     let currentEnd = new Date(currentStart)
    //     currentEnd.setMonth(currentStart.getMonth() + paymentCycle)
    //
    //     // 确保结束时间不超过合同结束时间
    //     if (currentEnd > contractEndTime) {
    //       currentEnd = new Date(contractEndTime)
    //     }
    //     const interval = {
    //       start: this.formatDate(currentStart), // 使用自定义格式化方法
    //       end: this.formatDate(currentEnd), // 使用自定义格式化方法
    //       paymentDate: null,
    //       yingshou: currentRent.toFixed(2)*this.dzItem.paymentCycle,
    //       rent: currentRent.toFixed(2),
    //       increasePercent: this.dzForm.dz
    //     }
    //
    //
    //     // 将付款日期转换为字符串格式
    //     interval.paymentDate = this.formatDate(interval.paymentDate)
    //
    //     // 检查是否需要递增
    //     if (currentStart >= dzStartTime) {
    //
    //
    //
    //
    //       // if(this.dzItem.dzType == '百分比'){
    //       if(this.dzForm.dzType == '百分比'){
    //         currentRent = currentRent * (1 + dzPercent) // 更新当前租金
    //         interval.increasePercent = dzPercent * 100
    //
    //       }else{
    //
    //         currentRent = parseFloat(currentRent) + parseFloat(this.dzForm.dz);
    //
    //       }
    //
    //
    //     }
    //
    //     intervals.push(interval)
    //
    //     // 更新当前开始时间为当前结束时间的下一天
    //     currentStart = new Date(currentEnd)
    //     // currentStart.setDate(currentStart.getDate() + 1);
    //     currentStart.setDate(currentStart.getDate())
    //   }
    //
    //   console.log(intervals)
    //
    //   for (let i = 0; i < this.dataForm.zcgl_htgl_pab_fytk.length; i++) {
    //
    //     if (this.dzItem.relatedSpace == this.dataForm.zcgl_htgl_pab_fytk[i].relatedSpace) {
    //
    //       this.dataForm.zcgl_htgl_pab_fytk[i].listDz = intervals
    //
    //     }
    //
    //   }
    //   this.dzDialog = false
    //   this.$forceUpdate()
    //   // 这里可以将 intervals 赋值给某个数据属性，以便在前端展示
    // },

    // formatDate(date) {
    //   if (date != null) {
    //     const year = date.getFullYear()
    //     const month = String(date.getMonth() + 1).padStart(2, '0')
    //     const day = String(date.getDate()).padStart(2, '0')
    //     return `${year}-${month}-${day}`
    //   }
    //
    // },

    onClose() {
      this.dzDialog = false

    },

    addDz(item) {
      this.dzDialog = true
      this.dzItem = item
    },

    toJsDj(item) {
      if (item.bhsUnit == null || item.bhsUnit == '') {

        this.$message({
          message: '请先选择租金单价单位！',
          type: 'error',
          duration: 1000
        })
        item.hsUnitPrice = ''
        return
      }


      if (item.relatedSpace == '' || item.relatedSpace == null || item.relatedSpace == undefined) {

        this.$message({
          message: '请先选择关联资产',
          type: 'error',
          duration: 1000
        })
        item.hsUnitPrice = ''
        item.monthlyRent = ''

      }

      if (item.bhsUnit == '0') {

        item.monthlyRent = (item.hsUnitPrice * item.landarea).toFixed(2)
        item.bhsUnitPrice = (item.hsUnitPrice - (item.hsUnitPrice * item.taxRate) / 100).toFixed(2)
      } else {

        item.monthlyRent = item.hsUnitPrice
        item.bhsUnitPrice = (item.hsUnitPrice - (item.hsUnitPrice * item.taxRate) / 100).toFixed(2)

      }

    },

    toGetArea(item) {
      var landarea = this.dataForm.zcglhtglpabspaceList.filter(item => item.id === item.relatedSpace).landarea
      if (landarea == null) {
        item.landarea = 100

      }
    },

    // 计算需要合并的单元格
    getSpanArr(data) {
      data.forEach((item, index) => {
        if (index === 0) {
          this.spanArr.push(1)
          this.position = 0
        } else {
          // 与上一行资产ID相同，合并
          if (data[index].relatedSpace === data[index - 1].relatedSpace) {
            this.spanArr[this.position] += 1
            this.spanArr.push(0)
          } else {
            this.spanArr.push(1)
            this.position = index
          }
        }
      })
    },
    // 定义合并规则
    objectSpanMethod({row, column, rowIndex, columnIndex}) {
      if (columnIndex === 0) {
        const _row = this.spanArr[rowIndex]
        const _col = _row > 0 ? 1 : 0
        return {
          rowspan: _row,
          colspan: _col
        }
      }
    },
    addFyQtTk() {
      this.dataForm.zcgl_htgl_pab_qtfytk.push({
        startTime: null
      })
    },
    addFytk() {


      this.dataForm.zcgl_htgl_pab_fytk.push({
        startTime: '',
        endTime: '',
        taxRate: '',
        hsUnit: '',
        bhsUnit: '1',
        relatedSpace: '',
        bhsUnitPrice: 0.00,
        hsUnitPrice: 0.00,
        earnestMoney: 0.00,
        defaultMoney: 0.00,
        monthlyRent: 0.00,
        paymentCycle: 1,
      })
    },
    removeFytk(index) {
      this.dataForm.zcgl_htgl_pab_fytk.splice(index, 1)
    },
    removeFyQttk(index){

      this.dataForm.zcgl_htgl_pab_qtfytk.splice(index, 1)
    },
    handleAddList(checkedRow) {
      // 接收子组件传递的 checkedRow 数据
      console.log(checkedRow, 11111111);
      this.dataForm.zcgl_htgl_pab_space1 = checkedRow;
      let num = 0;
      checkedRow.map((item) => {
        num += item.zcgl_zcdj_area.buildingmeasurementarea
      });
      this.dataForm.rentalArea = num;

      for (let i = 0; i < this.dataForm.zcgl_htgl_pab_fytk.length; i++) {
        this.dataForm.zcgl_htgl_pab_fytk[i].relatedSpace = this.dataForm.zcgl_htgl_pab_space1.map(space => space.id)
        this.dataForm.zcgl_htgl_pab_fytk[i].rentalArea = num
      }

      // 你可以在这里处理接收到的数据
    },
    handleCustomerNameChange(index, row) {
      if (!row.pabCustomerName) {
        // 如果选择的客户名称为空，可以清空其他字段
        row.otherField = ''
        return
      }
      // 调用接口获取其他字段的值
      this.fetchOtherField(row.pabCustomerName).then(response => {

        // 假设接口返回的数据包含 otherField 的值
        row.pabContactNumber = response.data.zcgl_customer_user.contactNumber
        row.pabIdNo = response.data.customerCreditCode
        row.pabIdType = response.data.customerType
        if (row.pabIdType === '1') {
          row.pabIdType = "办公";
        } else if (row.pabIdType === '2') {
          row.pabIdType = "商业";
        } else {
          row.pabIdType = "未知"; // 如果是其他类型，你可以设置默认值
        }
        row.pabContactAddress = response.data.detailedAddress
        row.pabContacts = response.data.zcgl_customer_user.contacts
      }).catch(error => {
        console.error('Failed to fetch other field:', error)
      })
    },
    getKhList() {

      request({
        url: '/api/example/ZcglCustomer/getAllList',
        method: 'post'
      }).then(res => {
        this.kfList = res.data
      })

    },
    fetchOtherField(customerId) {

      return request({
        url: '/api/example/ZcglCustomer/detail/' + customerId,
        method: 'get'
      })

      // 根据 customerId 调用接口

    },

    judgeShow(id) {
      if (!this.setting.formOperates || !this.setting.formOperates.length) return true
      let arr = this.setting.formOperates.filter(o => o.id === id) || []
      if (!arr.length) return true
      let item = arr[0]
      return item.read
    },
    judgeWrite(id) {

      if (!this.setting.formOperates || !this.setting.formOperates.length) return false
      let arr = this.setting.formOperates.filter(o => o.id === id) || []
      if (!arr.length) return true
      let item = arr[0]
      return !item.write
    },
    getcontractTypeOptions() {
      getDictionaryDataSelector('622532919440706373').then(res => {
        this.contractTypeOptions = res.data.list
      })
    },
    getHtNumber() {
      request({
        url: '/api/base/number/takeAc/HT/8',
        method: 'get'
      }).then(res => {
        console.log(res);
        this.dataForm.contractNumber = res.msg
      })
    },
    getprojectOptions() {
      getDictionaryDataSelector('622532443626277701').then(res => {
        this.projectOptions = res.data.list
      })
    },
    getpaymentDeadlineTypeOptions() {
      getDictionaryDataSelector('622533108956138312').then(res => {
        this.paymentDeadlineTypeOptions = res.data.list
      })
    },
    getpaymentDeadlineStatusOptions() {
      getDictionaryDataSelector('622533108956138313').then(res => {
        this.paymentDeadlineStatusOptions = res.data.list
      })
    },
    top() {
      if (parseInt(this.activezizgbo) > 0) {
        this.activezizgbo = (parseInt(this.activezizgbo) - 1).toString()
      }
      // this.$emit('refresh')

    },
    createSk() {
      this.$refs.elForm.validate((valid) => {
        if (valid) {
        } else {
          this.$message({
            message: "请输入必填参数！",
            type: 'error',
            duration: 1000
          })
          return

        }
      });


      var data = JSON.parse(JSON.stringify(this.dataForm))

      if (this.dataForm.zcgl_htgl_pab_space1.length == 0) {

        this.$message({
          message: "请选择合同资产！",
          type: 'error',
          duration: 1000
        })
        return
      }


      data.zcIds = this.dataForm.zcgl_htgl_pab_space1
        .map(item => item.id) // 提取每个元素的 `id` 字段
        .join(',') // 用逗号拼接成字符串

      for (let i = 0; i < this.dataForm.zcgl_htgl_pab_fytk.length; i++) {
        data.zcgl_htgl_pab_fytk[i].relatedSpace = this.dataForm.zcgl_htgl_pab_fytk[i].relatedSpace.join(',')
      }

      if(this.dzForm.dzType == '百分比'){

        data.incrementalType = 0
      }else{
        data.incrementalType = 1
      }

      if (data.contractType === '无固定期限') {
        // 无固定期限合同处理逻辑
        // 计算20年后的时间戳
        const twentyYearsInMillis = 10 * 365 * 24 * 60 * 60 * 1000;
        data.endTime = data.startTime + twentyYearsInMillis;
      } else {

      }

      // 假设 this.dzForm 存在并且 startTime 是有效的日期相关值
// 如果 startTime 是字符串，可能需要先转换为 Date 对象
// 这里假设 startTime 已经是 Date 对象

      // if(data.isIncreasing == 1){
      //   const startTime = this.dzForm.startTime;
      //   const year = startTime.getFullYear();
      //   const month = String(startTime.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始，所以要加 1，并补零
      //   const day = String(startTime.getDate()).padStart(2, '0');
      //
      //   const formattedDate = `${year}-${month}-${day}`;
      //   data.incrementalStartDate = formattedDate;
      //   data.incrementalNum = this.dzForm.dz;

      // }


      data.incrementalDatas = this.dzForm.incrementList

      for (let i = 0; i < data.incrementalDatas.length; i++) {
        var item = data.incrementalDatas[i]
        item.incrementalNum = item.dz
        item.incrementalType = item.dzType
        item.incrementalStartDate = item.startTime


      }

      request({
        url: '/api/example/ZcglHtglInfo/createSkjh',
        data: data,
        method: 'post'
      }).then(res => {
        this.skjh = res.data.skjhEntitys

        for (let i = 0; i < this.skjh.length; i++) {
          this.getSpanArr(this.skjh[i].listSk)
        }

        this.loading = false
        this.active = 2
      })

      console.log(JSON.stringify(this.dataForm) + '***')
    },
    // next() {
    //   // this.$emit('refresh')
    //   if (parseInt(this.activezizgbo) < 4) {
    //     this.activezizgbo = (parseInt(this.activezizgbo) + 1).toString()
    //   }
    // },
    init(data) {
      this.dataForm.id = data.id || ''
      this.setting = data


      if (data.flowTaskInfo != null) {

        this.setting['readonly'] = true

      }
      this.visible = true
      this.updateDataRule()
      this.$nextTick(() => {
        this.$refs['elForm'].resetFields()
        if (this.dataForm.id) {
          this.loading = true
          request({
            url: '/api/example/ZcglHtglInfo/' + this.dataForm.id,
            method: 'get'
          }).then(res => {
            this.dataInfo(res.data)
            this.loading = false
            this.skjh = res.data.skjhEntitys
          })
        }
        this.$emit('setPageLoad')
      })
      this.$store.commit('generator/UPDATE_RELATION_DATA', {})
    },
    updateDataRule() {
      // let newRules = {}
      // for (let i = 0; i < this.setting.formOperates.length; i++) {
      //   const item = this.setting.formOperates[i]
      //   if (!item.id.includes('-')) {
      //     const newRulesItem = {
      //       required: item.required,
      //       message: item.name + '不能为空',
      //       trigger: item.trigger || 'blur'
      //     }
      //     if (!this.dataRule.hasOwnProperty(item.id)) {
      //       if (item.required) this.$set(newRules, item.id, [newRulesItem])
      //     } else {
      //       let withoutRequiredItem = true
      //       for (let i = 0; i < this.dataRule[item.id].length; i++) {
      //         if (this.dataRule[item.id][i].hasOwnProperty('required')) {
      //           this.dataRule[item.id][i].required = item.required
      //           withoutRequiredItem = false
      //         }
      //       }
      //       if (withoutRequiredItem && item.required) this.dataRule[item.id].push(newRulesItem)
      //     }
      //   } else {
      //     let key = item.id.split('-')[0]
      //     let newId = item.id.split('-')[1]
      //     let newItem = {
      //       ...item,
      //       id: newId
      //     }
      //     if (!this.tableRequiredData.hasOwnProperty(key)) {
      //       this.$set(this.tableRequiredData, key, [newItem])
      //     } else {
      //       this.tableRequiredData[key].push(newItem)
      //     }
      //   }
      // }
      // this.dataRule = { ...this.dataRule, ...newRules }
    },
    exist() {
      let isOk = true
      for (let key in this.tableRequiredData) {
        if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
          for (let i = 0; i < this.dataForm[key].length; i++) {
            let item = this.dataForm[key][i]
            inner: for (let id in item) {
              let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
              if (!arr.length) continue inner
              if (arr[0].required) {
                let msg = `${arr[0].name}不能为空`
                let boo = true
                if (arr[0].dataType === 'array') {
                  boo = !this.jnpf.isEmptyArray(item[id])
                } else {
                  boo = !this.jnpf.isEmpty(item[id])
                }
                if (!boo) {
                  this.$message({
                    message: msg,
                    type: 'error',
                    duration: 1000
                  })
                  isOk = false
                  break
                }
              }
            }
          }
        }
      }
      return isOk
    },
    judgeRequired(id) {
      if (!this.formOperates || !this.formOperates.length) return false
      let arr = this.formOperates.filter(o => o.id === id) || []
      if (!arr.length) return false
      let item = arr[0]
      return item.required
    },
    // 表单提交
    dataFormSubmit(eventType, flowUrgent) {
      this.$refs['elForm'].validate((valid) => {
        if (valid) {
          if (this.exist && !this.exist()) return
          if (eventType === 'audit' || eventType === 'reject') {
            this.$emit('eventReceiver', this.dataForm, eventType)
            return
          }

          this.dataForm.status = eventType === 'submit' ? 0 : 1
          this.dataForm.flowId = this.setting.flowId
          this.dataForm.flowUrgent = flowUrgent

          this.eventType = eventType
          if (this.eventType === 'submit') {
            this.$confirm('您确定要提交当前流程吗, 是否继续?', '提示', {
              type: 'warning'
            }).then(() => {
              this.request()
            }).catch(() => {
            })
          } else {
            this.request()
          }
        }
      })
    },
    request() {
      var _data = this.dataList()

      if(this.dataForm.zcgl_htgl_pab == null || this.dataForm.zcgl_htgl_pab.length==0){
        this.$message({
          message: "请填写乙方客户信息",
          type: 'error',
          duration: 2000
        })
        return
      }


      var data = _data
      data.zcIds = this.dataForm.zcgl_htgl_pab_space1
        .map(item => item.id) // 提取每个元素的 `id` 字段
        .join(',') // 用逗号拼接成字符串


      for (let i = 0; i < this.dataForm.zcgl_htgl_pab_fytk.length; i++) {
        data.zcgl_htgl_pab_fytk[i].relatedSpace = this.dataForm.zcgl_htgl_pab_fytk[i].relatedSpace.join(',')
        data.zcgl_htgl_pab_fytk[i].rentalArea =  this.dataForm.rentalArea
      }

      data.zcgl_htgl_skjh = this.skjh

      if (!this.dataForm.id) {
        request({
          url: '/api/example/ZcglHtglInfo',
          method: 'post',
          data: data
        }).then((res) => {
          this.$message({
            message: res.msg,
            type: 'success',
            duration: 1000,
            onClose: () => {
              this.visible = false
              this.$emit('close', true)
            }
          })
        })
      } else {
        request({
          url: '/api/example/ZcglHtglInfo/' + this.dataForm.id,
          method: 'PUT',
          data: _data
        }).then((res) => {
          this.$message({
            message: res.msg,
            type: 'success',
            duration: 1000,
            onClose: () => {
              this.visible = false
              this.$emit('close', true)
            }
          })
        })
      }
    },
    addzcglhtglpabList() {
      let item = {
        pabCustomerName: undefined,
        pabContactNumber: undefined,
        pabIdType: undefined,
        pabIdNo: undefined,
        pabContactAddress: undefined
      }
      this.dataForm.zcgl_htgl_pab.push(item)
    },
    addzcgl_htgl_qtskzhList() {
      let item = {
        expenseItem: undefined,
        accountName: undefined,
        bankDeposit: undefined,
        accountNumber: undefined
      }
      this.dataForm.zcgl_htgl_qtskzhs.push(item)
    },
    addzcgl_htgl_qtydtkList() {
      let item = {
        clauseContent: undefined
      }
      this.dataForm.zcgl_htgl_qtydtks.push(item)
    },

    delzcglhtglpabList(index) {
      this.dataForm.zcgl_htgl_pab.splice(index, 1)
    },
    addzcglhtglpabspaceList() {
      let item = {
        spaceName: undefined,
        operatingArea: undefined,
        spaceType: undefined,
        rentalStatus: undefined
      }
      // this.dataForm.zcglhtglpabspaceList.push(item)
    },
    delzcglhtglpabspaceList(index) {



      this.dataForm.zcgl_htgl_pab_space1.splice(index, 1)
      var  checkedRow =   this.dataForm.zcgl_htgl_pab_space1
      let num = 0;
      checkedRow.map((item) => {
        num += item.zcgl_zcdj_area.buildingmeasurementarea
      });
      this.dataForm.rentalArea = num;
      for (let i = 0; i < this.dataForm.zcgl_htgl_pab_fytk.length; i++) {
        this.dataForm.zcgl_htgl_pab_fytk[i].relatedSpace = this.dataForm.zcgl_htgl_pab_space1.map(space => space.id)
        this.dataForm.zcgl_htgl_pab_fytk[i].rentalArea = num
      }
    },
    openSelectDialog(key) {
      this.currTableConf = this.addTableConf[key]
      this.currVmodel = key
      this.selectDialogVisible = true
      this.$nextTick(() => {
        this.$refs.selectDialog.init()
      })
    },
    addForSelect(data) {
      for (let i = 0; i < data.length; i++) {
        let item = {...this.tableRows[this.currVmodel], ...data[i]}
        this.dataForm[this.currVmodel].push(item)
      }
    },
    dataList() {
      var _data = JSON.parse(JSON.stringify(this.dataForm))

      // _data.ihis = parseInt(_data.ihis)
      //
      // _data.zcgl_htgl_pab_fytk.startTime = _data.jnpf_zcgl_htgl_pab_fytk_jnpf_startTime
      // _data.zcgl_htgl_pab_fytk.endTime = _data.jnpf_zcgl_htgl_pab_fytk_jnpf_endTime
      // _data.zcgl_htgl_pab_fytk.taxRate = _data.jnpf_zcgl_htgl_pab_fytk_jnpf_taxRate
      // _data.zcgl_htgl_pab_fytk.hsUnit = _data.jnpf_zcgl_htgl_pab_fytk_jnpf_hsUnit
      // _data.zcgl_htgl_pab_fytk.bhsUnit = _data.jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit
      // for (let i = 0; i < _data.zcglhtglpabList.length; i++) {
      //   var _list = _data.zcglhtglpabList[i]
      // }
      // for (let i = 0; i < _data.zcgl_htgl_pab_space1.length; i++) {
      //   var _list = _data.zcgl_htgl_pab_space1[i]
      // }
      return _data
    },
    dataInfo(dataAll) {
      let _dataAll = dataAll
      _dataAll.ihis = parseInt(_dataAll.ihis)
      // _dataAll.jnpf_zcgl_htgl_pab_fytk_jnpf_startTime = _dataAll.zcgl_htgl_pab_fytk.startTime
      // _dataAll.jnpf_zcgl_htgl_pab_fytk_jnpf_endTime = _dataAll.zcgl_htgl_pab_fytk.endTime
      // _dataAll.jnpf_zcgl_htgl_pab_fytk_jnpf_taxRate = _dataAll.zcgl_htgl_pab_fytk.taxRate
      // _dataAll.jnpf_zcgl_htgl_pab_fytk_jnpf_hsUnit = _dataAll.zcgl_htgl_pab_fytk.hsUnit
      // _dataAll.jnpf_zcgl_htgl_pab_fytk_jnpf_bhsUnit = _dataAll.zcgl_htgl_pab_fytk.bhsUnit
      // for (let i = 0; i < _dataAll.zcglhtglpabList.length; i++) {
      //   var _list = _dataAll.zcglhtglpabList[i]
      // }
      // for (let i = 0; i < _dataAll.zcgl_htgl_pab_space1.length; i++) {
      //   var _list = _dataAll.zcgl_htgl_pab_space1[i]
      // }

      this.dataForm = _dataAll
      this.dataForm.zcgl_htgl_pab_space1 = this.dataForm.zcgl_htgl_pab_space

      for (let i = 0; i < this.dataForm.zcgl_htgl_pab_space1.length; i++) {
        this.dataForm.zcgl_htgl_pab_space1[i].zcname = this.dataForm.zcgl_htgl_pab_space1[i].zcName
        this.dataForm.zcgl_htgl_pab_space1[i].zcnumber = this.dataForm.zcgl_htgl_pab_space1[i].zcNumber
        this.dataForm.zcgl_htgl_pab_space1[i].id = this.dataForm.zcgl_htgl_pab_space1[i].zcId
      }
      for (let i = 0; i < this.dataForm.zcgl_htgl_pab_fytk.length; i++) {
        this.dataForm.zcgl_htgl_pab_fytk[i].relatedSpace = this.dataForm.zcgl_htgl_pab_fytk[i].relatedSpace.split(",")
      }


    }
  }
}

</script>
<style scoped>
/* 增加表格行高 */
/deep/ .el-table .el-table__row {
  height: 43px; /* 你想要的行高 */
  border: 1px slategrey solid;
  color: black;
}

/* 如果你还想要调整单元格内部的垂直居中 */
/deep/ .el-table .cell {
  font-size: 16px;
  color: black;
  text-align: center;
  height: 43px; /* 和行高一致 */
  line-height: 44px; /* 垂直居中文本 */

}

/deep/ .el-form-item__label {

  color: black;
}

.fixed-bottom {
  z-index: 100;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  display: flex;
  justify-content: flex-end; /* 按钮靠右对齐 */
  padding: 10px;
  border-top: 1px solid #ccc; /* 可选：添加分割线 */
}

.confirm-button {
  margin-left: 20px;
  padding: 10px 20px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.confirm-button:hover {
  background-color: #0056b3;
}

.required {
  color: red;
}

/deep/ .el-input__inner {
  background: white !important;

}

/deep/ .el-textarea__inner {
  background: white !important;
}


</style>
